package org.lanqiao.tjut.chengxu04;

import java.util.Scanner;

public class Zhiyinshu {

	public static void main(String[] args) {
		int i;
		Scanner input = new Scanner(System.in);
		System.out.println("请输入一个数：");
		i = input.nextInt();
		System.out.print(i + "=");

		for (int j = 2; j < Math.sqrt(i)+1; j++) {

			while (i > j)
				if (i % j == 0) {
					//打印到倒数第二个（有星号）
					System.out.print(j + "*");
					i = i / j;

				} else {
					break;

				}

		}
		//打印最后一个数，每有星号
		System.out.print(i);
	}

}
